Use TypeAlias in builtins and complete a TODO item#9170
Closed
sobolevn wants to merge 1 commit intopython:mainfrom
Closed
Use TypeAlias in builtins and complete a TODO item#9170sobolevn wants to merge 1 commit intopython:mainfrom
TypeAlias in builtins and complete a TODO item#9170sobolevn wants to merge 1 commit intopython:mainfrom
Conversation
Member
Author
Not today! |
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: Expression (https://github.com/cognitedata/Expression)
+ expression/collections/block.py:317: error: Incompatible return value type (got "int", expected "Union[_TSourceSum, Literal[0]]") [return-value]
+ expression/collections/block.py:1036: error: Incompatible return value type (got "int", expected "Union[_TSourceSum, Literal[0]]") [return-value]
+ expression/collections/block.py:1043: error: Incompatible return value type (got "int", expected "Union[_TSourceSum, Literal[0]]") [return-value]
ignite (https://github.com/pytorch/ignite)
+ ignite/handlers/time_profilers.py:607: error: Incompatible types in assignment (expression has type "float", variable has type "int") [assignment]
|
Member
I haven't checked yet, but I wonder if python/mypy#14008 might have fixed this bug (not yet released, will be released as part of mypy 1.0). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From #9158 I understood that explicit type aliases are not a goal. But, this one is special. It has a TODO item and some history to it.
I am also curious about whether mypy now supports it.